package edu.hunau.aspect;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @author hb
 * @date 2023-04-14 16:22:51
 */
@Component
@Aspect
public class SpringAspectHelper {

    @Pointcut("execution(* edu.hunau.service.impl.*.*(..))")
    public void pointCut(){

    }

    @Before("execution(* edu.hunau.service.impl.Order*.*(..))")
    //https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#aop-advice-before
    //https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#aop-pointcuts-designators
    public void before(){
        System.out.println("**** 前置通知:before方法执行 ****");
    }

    @After("pointCut()")
    public void after(){
        System.out.println("**** 后置通知:after方法执行 ****");
    }

}
